package com.kamistoat.ruoyi.ruoyimodulessystem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kamistoat.ruoyi.ruoyiapisystem.domain.SysDictData;
import com.kamistoat.ruoyi.ruoyicommoncore.utils.page.PageUtils;
import com.kamistoat.ruoyi.ruoyiapisystem.entity.SysDictDataEntity;

import java.util.List;
import java.util.Map;

/**
 * 字典数据表
 *
 * @author kamistoat
 * @email linjianshanke@163.com
 * @date 2022-08-09 10:34:46
 */
public interface SysDictDataService extends IService<SysDictDataEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<SysDictDataEntity> selectDictDataList(SysDictData sysDictData);

    /**
     * 根据字典类型进行查询并入缓存
     */
    List<SysDictDataEntity> selectDictDataByTypeAndCache(String dictType);

    /**
     * 新增新的字典数据，并更新对应的字典类型缓存
     */
    boolean insertDictDataAndCache(SysDictDataEntity sysDictDataEntity);

    /**
     * 修改字典数据，并更新对应的字典类型缓存
     */
    boolean updateDictDataAndCache(SysDictDataEntity sysDictDataEntity);

    /**
     * 删除字典数据并清空缓存
     */
    boolean deleteDictDataByIdsAndRemoveCache(Long[] dictCodes);
}

